//
//  XQPopupAnimView.h
//  JoinPeso
//
//  Created by 小琦 on 2024/11/21.
//

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

typedef NS_ENUM(NSUInteger, XQPopupAnimationType) {
    XQPopupAnimationTop = 0,
    XQPopupAnimationBottom,
    XQPopupAnimationCenter,
    XQPopupAnimationLeft,
    XQPopupAnimationRight,
};


@interface XQPopupAnimView : UIView
@property (nonatomic, assign) XQPopupAnimationType animationType;
@property (nonatomic, assign) CGFloat duration;
@property (nonatomic, assign) CGFloat radius;
@property (nonatomic, assign) CGFloat customHeight;
/** 距离屏幕边缘的间距 */
@property (nonatomic, assign) CGFloat offset;
/** 位移动画时额外位移的值 */
@property (nonatomic, assign) CGFloat transformOffset;

/** 是否需要灰色遮罩 */
@property (nonatomic, assign) BOOL needCover;
/** 点击custom时是否销毁 */
@property (nonatomic, assign) BOOL hideWhenClickSelf;
/** 点击offset范围内时是否销毁 */
@property (nonatomic, assign) BOOL hideWhenClickOffset;
/** 点击透明区域内时是否销毁 */
@property (nonatomic, assign) BOOL hideWhenClickOutside;
/** 点击透明区域是否响应事件 */
@property (nonatomic, assign) BOOL canClickOutside;

@property (nonatomic, copy) void(^clickHandle)(void);
@property (nonatomic, copy) void(^makeCustomConstraints)(XQPopupAnimView *animView, UIView *customView);

- (instancetype)initWithAnimationType:(XQPopupAnimationType)animationType customView:(UIView *)customView;

- (void)showInView:(UIView * _Nullable)view completion:(void(^)(void))aCompletionBlock;
- (void)showInView:(UIView * _Nullable)view timingParameters:(id<UITimingCurveProvider> _Nullable)timingParameters completion:(void (^)(void))aCompletionBlock;

- (void)hideAndCompletion:(void(^)(void))aCompletionBlock;
@end

NS_ASSUME_NONNULL_END
